package models

import "time"

type Menu struct {
	ID            int64  `gorm:"primaryKey" json:"id"`
	Name          string `gorm:"column:name;type:varchar(255);not null" json:"name"`
	ParentID      int64  `gorm:"column:parent_id;not null" json:"parent_id"`
	Icon          string `gorm:"column:icon;type:varchar(255);not null" json:"icon"`
	Order         uint   `gorm:"column:order;not null" json:"order"`
	Path          string `gorm:"column:path;type:varchar(255);" json:"path"`
	Level         uint   `gorm:"column:level;type:tinyint(1);default:0;" json:"level"`
	ComponentName string `gorm:"column:component_name;type:varchar(100);" json:"component_name"`
	DeletedFlag   uint   `gorm:"column:delete_flag;type:tinyint(1);not null" json:"deleted_flag"`
	CreatedAt     time.Time
	UpdatedAt     time.Time
}

func (table *Menu) TableName() string {
	return "menu"
}
